#ifndef _CITY_ADT_H_
#define _CITY_ADT_H_

#define TRUE 1
#define FALSE 0

typedef struct cityCDT* cityADT;

cityADT newCity(int numBlocksX, int numBlocksY, int blockSizeX, int blockSizeY);
void freeCity(cityADT city);

//returns 0 if out of memmory, 1 if success
int registerCar(cityADT city, void* car);
int unRegisterCar(cityADT city, void * car);
int isCorner(cityADT city, int x, int y);
//int isFree(cityADT city, int x, int y);
int hasSemaphore(cityADT city, int x, int y);
int lockPos(cityADT city, int x, int y);
int unlockPos(cityADT city, int x, int y);


int getCityWidth(cityADT city);
int getCityHeight(cityADT city);

//Segundo parametro es del tipo carADT. Se retorna un carADT
void* hasThisPositionACar(cityADT city, int x, int y, int callerId);
void* hasSemaphoreInRed(cityADT city, int x, int y,int orientation);
void* getSemaphore(cityADT city, int x, int y);

int unRegisterSemaphore(cityADT city, int x, int y);
int registerSemaphore(cityADT city, void* semaphore, int x, int y);
#endif
